{extend name="base"}
{block name="title"}用户输赢7日{/block}
{block name="head"}{/block}
{block name="body"}
<body class="mainbody">
<form>
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
  <a href="{:url('index/home')}" class="home"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>用户输赢7日</span>
</div>
<!--/导航栏-->

<!--工具栏-->
<div id="floatHead" class="toolbar-wrap">
  <div class="toolbar">
    <div class="box-wrap">
      <a class="menu-btn"><i class="iconfont icon-more"></i></a>
      <div class="l-list">
        <div class="menu-list">
          <div class="rule-single-select">
            <select name="channel" style="display:none">
              <option value="0">===所有渠道===</option>
              {volist name="CHANNELS" id="val"}
              <option value="{$key}"{eq name="channel" value="$key"} selected{/eq}>[{$key}]{$val.Name}</option>
              {/volist}
            </select>
          </div>
          <div class="rule-single-select">
            <select name="show" style="display:none">
              {volist name="SHOWS" id="v"}
              <option value="{$key}"{eq name="show" value="$key"} selected{/eq}>[{$key}]{$v}</option>
              {/volist}
            </select>
          </div>
          <input type="text" class="input rule-date-input" autocomplete="off" {literal}onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d'})"{/literal} name="time" value="{$time|default=time()|date='Y-m-d',###}" title="查看该日期之前七日" />&nbsp;
          <input type="text" class="input" autocomplete="off" name="search" value="{$search|default=''|htmlentities}" placeholder="UserID/GameID/昵称" />
          <input type="text" class="input small" autocomplete="off" name="yqcode" value="{$yqcode|default=''|htmlentities}" placeholder="代理GameID" />
          <input type="text" class="input small" autocomplete="off" name="fmcode" value="{$fmcode|default=''|htmlentities}" placeholder="群主GameID" />
          <a class="btn-search"><i class="iconfont icon-search"></i></a>
        </div>
      </div>
    </div>
  </div>
</div>
<!--/工具栏-->

<!--列表-->
<div class="table-container">
<table class="ltable border-table">
  <tr>
    <th>渠道</th>
    <th>用户头像/昵称/GameID</th>
    <th>所属代理</th>
  {for start="6" end="0" comparison="EGT" step="-1"}
    <th>{:date('m-d', $time - $i * 24 * 60 * 60)}</th>
  {/for}
    <th>七日输赢</th>
    <th>累计输赢</th>
    <th>操作</th>
  </tr>
{empty name="list"}
  <tr><td colspan="13">Oh~暂无数据!</td></tr>
{else/}
  {volist name="list" id="v"}
  <tr data-GameID="{$v.GameID}">
    <td title="{$v.Channel}">{$CHANNELS[$v.Channel]['Name'] ?? '--'}</td>
    <td class="user-avatar">
      <a target="_blank" href="{:url('user.detail/index')}?UserID={$v.UserID}">
        <img src="{$v.AccountImgUrl?:'__STATIC__/houtai/images/dface.png'}" />
      </a>
      <div class="user-box">
        <h4><a{eq name="v.AccountsType" value="1"} class="red"{/eq} target="_blank" href="{:url('user.detail/index')}?UserID={$v.UserID}">{:htmlentities($v.NickName)}</a></h4>
        <i>{$v.GameID}</i>
      </div>
    </td>
    <td class="user-avatar">
      <a target="_blank" href="{:url('user.detail/index')}?UserID={$v.AUserID}">
        <img src="{$v.AHeadImgUrl?:'__STATIC__/houtai/images/dface.png'}" />
      </a>
      <div class="user-box">
        <h4><a{eq name="v.AccountsType" value="1"} class="red"{/eq} target="_blank" href="{:url('user.detail/index')}?UserID={$v.AUserID}">{:htmlentities($v.ACompellation)}</a></h4>
        <i>{$v.AGameID}</i>
      </div>
    </td>
    <td class="tr<?php if($show==2 ? ($v['day_6']>0) : ($v['day6']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-6*60*60*24)}&time2={:date('Y-m-d', $time-6*60*60*24)}">{in name="show" value="0,1"}{$v.day6}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_6|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_5']>0) : ($v['day5']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-5*60*60*24)}&time2={:date('Y-m-d', $time-5*60*60*24)}">{in name="show" value="0,1"}{$v.day5}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_5|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_4']>0) : ($v['day4']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-4*60*60*24)}&time2={:date('Y-m-d', $time-4*60*60*24)}">{in name="show" value="0,1"}{$v.day4}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_4|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_3']>0) : ($v['day3']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-3*60*60*24)}&time2={:date('Y-m-d', $time-3*60*60*24)}">{in name="show" value="0,1"}{$v.day3}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_3|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_2']>0) : ($v['day2']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-2*60*60*24)}&time2={:date('Y-m-d', $time-2*60*60*24)}">{in name="show" value="0,1"}{$v.day2}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_2|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_1']>0) : ($v['day1']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-1*60*60*24)}&time2={:date('Y-m-d', $time-1*60*60*24)}">{in name="show" value="0,1"}{$v.day1}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_1|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_0']>0) : ($v['day0']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-0*60*60*24)}&time2={:date('Y-m-d', $time-0*60*60*24)}">{in name="show" value="0,1"}{$v.day0}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_0|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['day_7']>0) : ($v['day7']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}&time1={:date('Y-m-d', $time-6*60*60*24)}&time2={:date('Y-m-d', $time-0*60*60*24)}">{in name="show" value="0,1"}{$v.day7}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.day_7|round}{/in}</a></td>
    <td class="tr<?php if($show==2 ? ($v['days2']>0) : ($v['days']>0)):?> red<?php endif; ?>"><a target="_blank" href="{$URL_GAME_INDEX}?search={$v.GameID}">{in name="show" value="0,1"}{$v.days}{/in}{eq name="show" value="0"}<br/>{/eq}{in name="show" value="0,2"}${$v.days2|round}{/in}</a></td>
    <td><a class="input">redis</a></td>
  </tr>
  {/volist}
{/empty}
</table>
</div>
<!--/列表-->

<!--内容底部-->
<div class="page-footer"><div class="btn-wrap">{$list->render()}</div></div>
<!--/内容底部-->

</form>
<script>
$(function () {
  $.UserControl.init({
    URL_DETAIL: "{:url('user.redis.control/detail')}",
    URL_DELONE: "{:url('user.redis.control/delone')}",
    URL_DELALL: "{:url('user.redis.control/delall')}",
    URL_DELLOG: "{:url('user.redis.control/dellog')}",
  });
  $('table.ltable td:last-child a.input').click(function () {
    var GameID = $(this).parents('tr').attr('data-GameID');
    $.UserControl.ShowDetailDialog(GameID);
  });
});
</script>
</body>
{/block}